using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PearlyGates;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Graphics;

namespace PearlyGates
{
    class Tutorial : GameScreen
    {
        Texture2D background;
        Song backgroundSong;

        public override void LoadContent()
        {
            background = ScreenManager.Game.Content.Load<Texture2D>("tutorial");
            backgroundSong = ScreenManager.Game.Content.Load<Song>("backgroundSongTutorial");

            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume = 1.0f;
            MediaPlayer.Play(backgroundSong);


            base.LoadContent();
        }

        public override void HandleInput(InputState input)
        {
            PlayerIndex playerIndex;
            if (input.IsMenuCancel(null, out playerIndex))
            {
                MediaPlayer.Stop();
                ScreenManager.AddScreen(new Menu(), null);
                ExitScreen();
            }

            if (input.TouchState.Count > 0)
            {
                Vector2 touchPosition = input.TouchState[0].Position;

                if (touchPosition.X > 553 && touchPosition.Y > 422 && touchPosition.X < 800 && touchPosition.Y < 480)
                {
                    ScreenManager.AddScreen(new Tutorial_1(), null);
                    ExitScreen();
                }
            }

            base.HandleInput(input);
        }

        public override void Draw(GameTime gameTime)
        {
            ScreenManager.SpriteBatch.Begin();
            ScreenManager.SpriteBatch.Draw(background, Vector2.Zero, Color.White);
            ScreenManager.SpriteBatch.End();

            base.Draw(gameTime);
        }
    }
}
